projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9ae5c0a
)
Fix undefined behavior in mapbacktrace
author
Philipp Stephani
<phst@google.com>
Mon, 5 Jun 2017 20:09:00 +0000
(22:09 +0200)
committer
Philipp Stephani
<phst@google.com>
Mon, 5 Jun 2017 20:09:22 +0000
(22:09 +0200)
* src/eval.c (Fmapbacktrace): Don't assume that PDL is still valid.
src/eval.c
patch
|
blob
|
history
diff --git
a/src/eval.c
b/src/eval.c
index ef961046bcfac22735323809ded07f541118c80c..8f293c9d3002aa5f62aa70c4af4072a2ef20ddb9 100644
(file)
--- a/
src/eval.c
+++ b/
src/eval.c
@@
-3613,8
+3613,12
@@
returns nil. */)
while (backtrace_p (pdl))
{
+ ptrdiff_t i = pdl - specpdl;
backtrace_frame_apply (function, pdl);
- pdl = backtrace_next (pdl);
+ /* Beware! PDL is no longer valid here because FUNCTION might
+ have caused grow_specpdl to reallocate pdlvec. We must use
+ the saved index, cf. Bug#27258. */
+ pdl = backtrace_next (&specpdl[i]);
}
return Qnil;